package com.chz.SupermarketMS.service;

import com.chz.SupermarketMS.dao.KindRepository;
import com.chz.SupermarketMS.entities.Kind;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class KindService {

    @Autowired
    KindRepository kindRepository;

    public Kind save(Kind kind){
        return kindRepository.save(kind);
    }

    public List<Kind> getAll(){
        return kindRepository.findAll();
    }

    public Kind findByKindId(long theId) {
        return kindRepository.findByKindId(theId);
    }

    public void delete(Kind theKind) {
        kindRepository.delete(theKind);
    }
}
